import request from "@/api/index";

/**
 * 题库模块
 */
//根据课程查询题目
export function getQueryBankListAPI(courseId, questionType, pageNum, pageSize, keyWord) {
    return request.get(`/sc/exam/qbank/queryBankList?courseId=${courseId}&questionType=${questionType}&pageNum=${pageNum}&pageSize=${pageSize}&keyWord=${keyWord}`)
}
//增加题目
export function postAddBankAPI(data) {
    return request.post(`/sc/exam/qbank/addBank`, data)
}
//（批量）删除题目  
export function deleteBatchBankAPI(ids) {
    return request.post(`/sc/exam/qbank/deleteBatchBank`, ids)
}
//题目查询（单查）  /sc/exam/qbank/queryBank/{id}
export function getqueryBankAPI(id) {
    return request.get(`/sc/exam/qbank/queryBank/${id}`)
}
//题目更新   /sc/exam/qbank/updateBank
export function updateBankAPI(data) {
    return request.post(`/sc/exam/qbank/updateBank`, data)
}

/**
 * 知识点模块
*/
//知识点多查  
export function getBatchPointAPI(BelongCourseId, pageNumber, pageSize, keyWord) {
    return request.get(`/sc/exam/knowledgePoint/getBatchPoint/${BelongCourseId}/${pageNumber}/${pageSize}?keyWord=${keyWord}`)
}
//增加知识点  
export function insertPointAPI(data) {
    return request.post(`/sc/exam/knowledgePoint/insertPoint`, data)
}
//更新知识点  
export function updatePointAPI(data) {
    return request.put(`/sc/exam/knowledgePoint/updatePoint`, data)
}
//删除知识点  
export function deleteBatchPointAPI(ids) {
    return request.delete(`/sc/exam/knowledgePoint/deleteBatchPoint`, {
        data: ids
    })
}

/**
 * 登录模块
 */
//登出    
export function logoutAPI() {
    return request.post(`/ac/system/index/logout`)
}

/**
 * 部门模块
 */
//树形部门列表查询  /ac/system/sysDept/findNodes
export function findNodesAPI() {
    return request.get(`/ac/system/sysDept/findNodes`)
}
//按部门名查找  
export function findDeptAPI(keyWord) {
    return request.get(`/ac/system/sysDept/findDept?keyWord=${keyWord}`)
}
//按id查找部门  
export function findDeptIdAPI(id) {
    return request.get(`/ac/system/sysDept/findDeptId?id=${id}`)
}
//新增部门    
export function insertDeptAPI(data) {
    return request.post(`/ac/system/sysDept/save`, data)
}
//删除部门 
export function deleteDeptAPI(id) {
    return request.delete(`/ac/system/sysDept/removeById/${id}`,)
}
//更新部门  
export function updateDeptAPI(data) {
    return request.put(`/ac/system/sysDept/update`, data)
}
//根据部门查询用户   /ac/system/sysDeptUser/getUserBudeptId
export function getUserBudeptIdAPI(deptId,pageNum, pageSize) {
    return request.get(`/ac/system/sysDeptUser/getUserBudeptId?deptId=${deptId}&pageNum=${pageNum}&pageSize=${pageSize}`)
}

/**
 * 用户模块
 */
//获取用户信息  
export function getUserInfoAPI() {
    return request.get(`ac/system/index/userInfo`)
}
//查询用户列表    
export function findByPageAPI(pageNum, pageSize,keyword) {
    return request.get(`/ac/system/sysUser/findByPage/${pageNum}/${pageSize}?keyword=${keyword}`)
}
//新增用户 
export function saveSysUserAPI(data) {
    return request.post(`/ac/system/sysUser/saveSysUser`, data)
}
//删除用户   /ac/system/sysUser/deleteById/{userId}
export function deleteUserByIdAPI(userId) {
    return request.delete(`/ac/system/sysUser/deleteById/${userId}`)
}
//更新用户    /ac/system/sysUser/updateSysUser
export function updateSysUserAPI(data) {
    return request.put(`/ac/system/sysUser/updateSysUser`, data)
}

/**
 * 试卷模块
 */
//获取用户信息  
//手动组卷    /sc/exam/epaper/addExamPaper   /sc/exam/epaper/addExamPaper
export function addExamPaperAPI(data) {
    return request.post(`/sc/exam/epaper/addExamPaper`, data)
}
//获取试卷详情   /sc/exam/epaper/selectExamPaper/{epId}
export function selectExamPaperAPI(epId) {
    return request.get(`/sc/exam/epaper/selectExamPaper/${epId}`)
}
//更新试卷  /sc/exam/epaper/updateExamPaper
export function updateExamPaperAPI(data) {
    return request.put(`/sc/exam/epaper/updateExamPaper`, data)
}
//根据课程查询试卷列表
export function getExamPaperByCourseIdAPI(courseId, pageNum, pageSize) {
    return request.get(`/sc/exam/epaper/getExamPaperByCourseId/${courseId}/${pageNum}/${pageSize}`)
}
//删除试卷  
export function deleteExamPaperAPI(ids) {
    return request.delete(`/sc/exam/epaper/deleteExamPaper`, {
        data: ids
    })
}

/**
 * 考试模块
 */
//根据课程学期获取考试列表  /sc/exam/Exam/getExamByCourseIdSemester/{courseId}/{pageNum}/{PageSize}
export function getExamByCourseIdSemesterAPI(courseId, pageNum, PageSize, semester) {
    return request.get(`/sc/exam/Exam/getExamByCourseIdSemester/${courseId}/${pageNum}/${PageSize}?semester=${semester}`)
}
//教师获取考试详情   /sc/exam/Exam/getExamDetail/{id}
export function getExamDetailAPI(examId) {
    return request.get(`/sc/exam/Exam/getExamDetail//${examId}`)
}
//根据id删除考试      /sc/exam/Exam/deleteExam
export function deleteExamAPI(examId) {
    return request.delete(`/sc/exam/Exam/deleteExam`, {
        data: examId
    })
}
//创建考试    /sc/exam/Exam/createExam
export function createExamAPI(data) {
    return request.post(`/sc/exam/Exam/createExam`, data)
}
//更新考试    /sc/exam/Exam/updateExam
export function updateExamAPI(data) {
    return request.post(`/sc/exam/Exam/updateExam`, data)
}

/**
 * 课程模块
 *  */
//课程多查
export function getCourseListAPI(teachId, pageNum, pageSize) {
    return request.get(`/sc/exam/course/getCourseList/5/1/5`)
}
//根据课程id查询课程   /sc/exam/course/getCourseById
export function getCourseByIdAPI(courseId) {
    return request.get(`/sc/exam/course/getCourseById?courseId=${courseId}`)
}
//新增课程       /sc/exam/course/addCourse
export function addCourseAPI(data) {
    return request.post(`/sc/exam/course/addCourse`, data)
}
//更新课程   /sc/exam/course/updateCourse
export function updateCourseAPI(data) {
    return request.put(`/sc/exam/course/updateCourse`, data)
}
//删除课程   /sc/exam/course/deleteCourse
export function deleteCourseAPI(courseId) {
    return request.delete(`/sc/exam/course/deleteCourse`, {
        data: courseId
    })
}

/**
 * 班级模块
 */
//根据课程查询班级   /sc/exam/classes/getClassByCourse
export function getClassByCourseAPI(courseId, pageNum, pageSize) {
    return request.get(`/sc/exam/classes/getClassByCourse?courseId=${courseId}&pageNum=${pageNum}&pageSize=${pageSize}`)
}
//往班级添加学生、课程    /sc/exam/classes/addCls
export function addClsAPI(data) {
    return request.post(`/sc/exam/classes/addCls`, data)
}

/**
 * 通知模块
 */
//新增通知    /sc/exam/notice/insertNotice
export function insertNoticeAPI(data) {
    return request.post(`/sc/exam/notice/insertNotice`, data)
}